package mx.itesm.timeburrito;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.view.MotionEvent;
import android.view.View;

public class MenuGameOver {
	
	private static final int OPCION_EMPEZAR = 0;
	private static final int OPCION_SALIR = 1;
	

	public static void MostrarGameOver(Canvas canvas, Paint p, View v, int marcador){
		p.setColor(0xAA000000);
		canvas.drawRect(0, 0, v.getWidth(), v.getHeight(), p);
		p.setColor(Color.BLUE);
		p.setTextSize(40);
		p.setAntiAlias(true);
		canvas.drawText("GAME OVER", canvas.getWidth()/3, canvas.getHeight()/6, p);
		p.setColor(Color.YELLOW);
		p.setTextSize(30);
		canvas.drawText("Volver a jugar", canvas.getWidth()/2,canvas.getHeight()/2, p);
		canvas.drawText("Salir", canvas.getWidth()/2, canvas.getHeight()/3*2, p);
		ReadWrite.setScore(1, "porro", marcador);
			
			
		
		canvas.drawText("Marcador: "+marcador , canvas.getWidth()/2 , canvas.getHeight()/6*2,p );
		
	}
	
public static int opcionesGameOver(MotionEvent event, int canvasHeight, int canvasWidth,Paint p) {
		
		float xEvento=event.getRawX();
		float yEvento=event.getRawY();
		if(xEvento>=canvasWidth/2)
			if(canvasHeight/2-p.getTextSize()<=yEvento && yEvento<=canvasHeight/3*2-p.getTextSize())
				return OPCION_EMPEZAR;
		if(xEvento>=canvasWidth/2)
			if(canvasHeight/3*2<=yEvento)
				return OPCION_SALIR;
		
		return -1;
		
	}
}
